import React from "react";
import { HashRouter, Route, Routes, Navigate } from "react-router-dom";
import { lazy, Suspense } from 'react';
const Manage = lazy(() => import('../pages/manage/manage'))
const Index = lazy(() => import('../pages/index/index'))
const Userlist = lazy(() => import('../pages/userlist/userlist'))
const Shoplist = lazy(() => import('../pages/shoplist/shoplist'))
const Visitor = lazy(() => import('../pages/visitor/visitor'))
const BasicRoute = () => (
    <HashRouter>
        <Suspense fallback={''}>
            <Routes>
                <Route path="/" element={<Navigate to="manage"></Navigate>}></Route>

                <Route path='/' element={<Index />}>
                    <Route path='manage' element={<Manage />}></Route>
                    <Route path='userlist' element={<Userlist />}></Route>
                    <Route path='shoplist' element={<Shoplist />}></Route>
                    <Route path='visitor' element={<Visitor />}></Route>
                </Route>
            </Routes>
        </Suspense>
    </HashRouter>
)
export default BasicRoute